package main

import "fmt"

func main() {

	//numbers2:=[...]int{1,2,3,4,5,6}
	//maxIndex2:=len(numbers2)-1
	//for i,e:=range numbers2{
	//	fmt.Printf("number2值为：%v,maxIndex2值为:%v e的值为:%v\n ",numbers2,maxIndex2,e)
	//	if i==maxIndex2{
	//		numbers2[0]+=e
	//	}else {
	//		numbers2[i+1]+=e
	//	}
	//}
	//fmt.Println(numbers2)


	// 示例3。
	numbers3 := []int{1, 2, 3, 4, 5, 6}
	maxIndex3 := 6 - 1
	for i, e := range numbers3 {
		fmt.Printf("numbers3：%v,i值为:%v v的值为:%v\n ", numbers3, i, e)
		if i == maxIndex3 {
			numbers3[0] += e
		} else {
			numbers3[i+1] += e
		}
	}
	fmt.Println(numbers3)
}
